<template>
  <view>
    <image :style="{width: width+'rpx',height: height+'rpx', borderRadius: bdRds}" @click.stop="clickImg(imageUrl)" :src="imageUrl"
      mode="aspectFill"></image>
  </view>
</template>

<script>
  export default {
    props: {
      width: {
        type: Number
      },
      height: {
        type: Number
      },
      bdRds: {
        type: String,
        default: "50%"
      },
      imageUrl: {
        type: String
      }
    },
    data() {
      return {

      }
    },
    methods: {
      clickImg(url) {
        console.log("预览图片路径", url);
        // 预览图片
        uni.previewImage({
          urls: [url],
          longPressActions: {
            itemList: ['发送给朋友', '保存图片', '收藏'],
            success: function(data) {
              console.log(data);
            },
            fail: function(err) {
              console.log(err.errMsg);
            }
          }
        });
      },
    }
  }
</script>

<style lang="scss" scoped>

</style>